package com.csxy.six.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.csxy.six.entity.ReadLog;
import com.csxy.six.mapper.ReadLogMapper;
import com.csxy.six.service.ReadLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ReadLogServiceImpl extends ServiceImpl<ReadLogMapper, ReadLog> implements ReadLogService {

    @Autowired
    private ReadLogMapper readLogMapper;

    // 记录阅读日志
    @Override
    public boolean recordRead(Integer userId, Integer announceId) {
        return readLogMapper.insertOrUpdate(userId, announceId) > 0;
    }
}
